package com.jugheadzhou.emrpoc.mapper;

import com.jugheadzhou.emrpoc.model.MedicalRecordContent;
import com.jugheadzhou.emrpoc.mybatis.CommonMapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author jugheadzhou
 * @date 2021-10-24
 */
public interface MedicalRecordContentMapper extends CommonMapper<MedicalRecordContent> {

    /**
     * 判断病历内容是否存在
     *
     * @param recordId
     * @return
     */
    int exitsByRecordId(@Param("recordId") String recordId);

    /**
     * 通过病历记录ID和版本号查询
     *
     * @param recordId
     * @param version
     * @return
     */
    MedicalRecordContent selectByRecordIdAndVersion(@Param("recordId") String recordId, @Param("version") Integer version);

    /**
     * 通过病历记录ID查询版本号最大的内容记录
     *
     * @param recordId
     * @return
     */
    MedicalRecordContent selectByRecordIdAndMaxVersion(@Param("recordId") String recordId);

}
